<h1>Listing invitations</h1>

<p>
  <%= link_to 'Group', group_path(@group) %> |
  <%= link_to 'Memberships', group_memberships_path(@group) %> | 
  <%= link_to 'Invitations', group_invitations_path(@group) %>
</p>

<table>
  <tr>
    <th>Group</th>
    <th>Email</th>
    <th>Sent</th>
    <th> </th>
  </tr>

<% for invitation in @invitations %>
  <tr>
    <td><%=h @group.name %></td>
    <td><%=h invitation.email %></td>
    <td><%=h invitation.created_at.to_s %></td>
    <td><%= link_to 'Destroy', group_invitation_path(@group,invitation), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<%= link_to 'New invitation', new_group_invitation_path %>